From 1cded7dd3c99c519538b41b76bb3b8ba0947ffbd Mon Sep 17 00:00:00 2001 From: "kaf24@freefall.cl.cam.ac.uk" Date: Sat, 30 Oct 2004 11:42:28 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.312 (41837e24AgGTJo-4Cu3-XiU5i0cX2w) Some very small time cleanups. Also call cur_timer->init during resume. --- .../arch/xen/i386/kernel/time.c | 27 +++++++++++-------- .../arch/xen/i386/kernel/timers/timer_tsc.c | 5 +--- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c index 9a11137f07..1edc1cbf83 100644 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c @@ -675,21 +675,26 @@ int set_timeout_timer(void) void time_suspend(void) { + /* nothing */ } +/* No locking required. We are only CPU running, and interrupts are off. */ void time_resume(void) { - unsigned long flags; - write_seqlock_irqsave(&xtime_lock, flags); - /* Get timebases for new environment. */ - __get_time_values_from_xen(); - /* Reset our own concept of passage of system time. */ - processed_system_time = shadow_system_time; - /* Accept a warp in UTC (wall-clock) time. */ - last_seen_tv.tv_sec = 0; - /* Make sure we resync UTC time with Xen on next timer interrupt. */ - last_update_from_xen = 0; - write_sequnlock_irqrestore(&xtime_lock, flags); + if (cur_timer->init(NULL) != 0) + BUG(); + + /* Get timebases for new environment. */ + __get_time_values_from_xen(); + + /* Reset our own concept of passage of system time. */ + processed_system_time = shadow_system_time; + + /* Accept a warp in UTC (wall-clock) time. */ + last_seen_tv.tv_sec = 0; + + /* Make sure we resync UTC time with Xen on next timer interrupt. */ + last_update_from_xen = 0; } /* diff --git a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c index 683ad982ca..d4d64de094 100644 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c @@ -332,7 +332,6 @@ static inline void cpufreq_delayed_get(void) { return; } static int __init init_tsc(char* override) { - unsigned long long alarm; u64 __cpu_khz; __cpu_khz = HYPERVISOR_shared_info->cpu_freq; @@ -353,9 +352,7 @@ static int __init init_tsc(char* override) set_cyc2ns_scale(cpu_khz/1000); - rdtscll(alarm); - - use_tsc=1; + use_tsc = 1; return 0; } -- 2.30.2